/*
 *  $Id: GuardSpiritSouth.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Light.Abilities {
    public class GuardSpiritSouth: AbilityCard<Creature> {
        public GuardSpiritSouth(): base("001_l_a_guard_spirit_south") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Light;
            Target = CreatureTarget.Enemy;
            AddManaCost(ElementType.Light, 1);
        }

        protected override void DoAction(TargetArgs<Creature> args) {
            Creatures.GuardianOfTheSouth.DamageCollector collector = args.Caster.GetAffect<Creatures.GuardianOfTheSouth.DamageCollector>();
            if (collector == null) return;
            args.Caster.RemoveAffect(collector);
            if (collector.Damage == 0) return;
            args.Target.DamageBy(NewDamage(args, DamageType.PhysicalAttack, collector.Damage));
        }
    }
}
